-
Couldn't load subscription status.
- Fork 14
CLOUDP-304946: IPA rule update must return 200 ok #542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| * @param errorMessage the error message | ||
| * @returns {*[]|[{path, message}]} the errors found, or an empty array in case of no errors | ||
| */ | ||
| export function checkResponseCodeAndReturnErrors(operationObject, expectedStatusCode, path, ruleName, errorMessage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
|
|
||
| if ( | ||
| !isSingleResourceIdentifier(resourcePath) && | ||
| !(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(resourcePaths)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: For Update methods, should we consider singleton URIs? I would say we can look only for single resource URIs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since singletons should and can have Update methods, we should cover them here as well, similarly to the get methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is a similar case to Get methods. Cool, thanks!
tools/spectral/ipa/__tests__/updateResponseCodeShouldBe200OK.test.js
Outdated
Show resolved
Hide resolved
|
Thank you for the fix |
Proposed changes
Adds rules
xgen-IPA-107-put-method-response-code-is-200andxgen-IPA-107-patch-method-response-code-is-200.Added tests
Also did some refactoring to use a common validation method since we have a lot of similar rules checking for the response code.
Jira ticket: CLOUDP-304946